package javaapplication1;

import java.awt.*;

public class test extends Frame {

    static Label l;

    test(String s) {
        super(s);

        setLayout(null);
        setBackground(Color.white);
        setSize(700, 500);
        setVisible(true);

        l = new Label("Hello");
        l.setBounds(0, 200, 80, 20);
        add(l);

    }

    void my() {
        int i;

        while (true) {
            for (i = 0; i < 670; i += 10) {
                setBackground(Color.BLUE);

                try {
                    l.setBounds(0 + i, 200, 50, 20);
                    setBackground(Color.GREEN);
                    Thread.sleep(90);

                } catch (Exception e) {
                }
            }

            while (i != 0) {
                setBackground(Color.GREEN);
                try {
                    i = i - 10;

                    l.setBounds(i, 200, 50, 20);
                    setBackground(Color.BLUE);
                    Thread.sleep(90);
                } catch (Exception e) {
                }
            }
        }
    }

    public static void main(String k[]) {
        test ob = new test("Myframe3");
        ob.my();
    }
}
